//
//  ChannelPage_ConllevtionViewCell.m
//  STL_ Animation
//
//  Created by 孙健 on 16/4/5.
//  Copyright © 2016年 STL. All rights reserved.
//

#import "ChannelPage_ConllevtionViewCell.h"

@implementation ChannelPage_ConllevtionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.imageViewTitle = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.imageViewRight = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.labelTop = [[UILabel alloc] initWithFrame:CGRectZero];
        self.labelTitle = [[UILabel alloc] initWithFrame:CGRectZero];
        self.labelTitle.textColor = [UIColor colorWithRed:0/255.0 green:194/255.0 blue:121/255.0 alpha:1];
        self.labelTop.textColor = [UIColor grayColor];
        
        self.labelTitle.font = [UIFont systemFontOfSize:12];
        self.labelTop.font = [UIFont systemFontOfSize:12];
        
        [self.contentView addSubview:self.imageViewRight];
        [self.contentView addSubview:self.imageViewTitle];
        [self.contentView addSubview:self.labelTitle];
        [self.contentView addSubview:self.labelTop];
    }
    return self;
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    self.imageViewTitle.frame = CGRectMake(0, 0, self.contentView.bounds.size.height, self.contentView.bounds.size.height);
    [self.imageViewTitle.layer setCornerRadius:CGRectGetHeight([self bounds])/2];
    self.imageViewTitle.layer.masksToBounds = YES;
    self.labelTop.frame = CGRectMake(self.contentView.bounds.size.height + 10, self.contentView.bounds.size.height/6 * 2, 100, self.contentView.bounds.size.height/6);
    self.labelTitle.frame = CGRectMake(self.contentView.bounds.size.height + 10, self.contentView.bounds.size.height/6 * 3  + 10, 100, self.contentView.bounds.size.height/6);
    self.imageViewRight.frame = CGRectMake(self.contentView.bounds.size.width - 90, self.contentView.bounds.size.height/6 * 2, 60, self.contentView.bounds.size.height/6 * 2);
}

- (void)setArtistModel:(ChannelPage_artistModel *)artistModel {
    
    _artistModel = artistModel;
    [self.imageViewTitle sd_setImageWithURL:[NSURL URLWithString:artistModel.artistAvatar]];
    self.labelTop.text = @"艺人";
    self.labelTitle.text = artistModel.artistName;
    self.imageViewRight.image = [[UIImage imageNamed:@"xiangyou"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}



@end
